package com.linjiang.loadbalance;

import com.linjiang.common.URL;

import java.util.List;
import java.util.Random;

public class Loadbalance {

    /**
     * 随机策略
     * @return
     */
    public URL random(List<URL> urlList){
        //生成获取数组下标的随机数
        Random random = new Random();
        int index = random.nextInt(urlList.size());
        return urlList.get(index);
    }
}
